﻿#define _CRT_SECURE_NO_WARNINGS
#include<iostream>
#include<string>
#include"MyArray.h"
using namespace std;

void func(int element);

void test01() {
	MyArray *arr = new MyArray;
	for (int i = 0; i < 10; i++) {
		arr->PushFront(i+10);
	}
	arr->Insert(3, 30);
	arr->Insert(5, 40);
	arr->Insert(7, 50);
	arr->Insert(18, 90);

	arr->forEach(*func); // 遍历打印 
}

void func(int element) {
	cout << element << ", ";
}

int main()
{

	test01(); 

	system("pause");
	return EXIT_SUCCESS;
}